;

#pragma once
#include <string>
#include <cocos2d.h>

using namespace std;

enum class MessageTarget {
	all,
	armies_scene,
	formation_scene,
	unit_scene,
	game_scene,
	campaign_scene,
	shop_scene,
	online_battle_scene,
	model_layer,
	count
};

enum class MessageFlag {
	pauseGame,
	resumeGame,

	new_unit,
	update_grid_info,

	model_layer_closed,

	count
};

struct MessageData {
	MessageTarget sender;
	MessageTarget receiver;
	MessageFlag key;
	string strValue;
	int intValue;
	int arrValue[8];
	cocos2d::CCPoint ptValue;
	void* pData;

	MessageData():
				sender(MessageTarget:: count),
				receiver(MessageTarget::count),
				key(MessageFlag::count),
				intValue(0),
				ptValue(cocos2d::CCPointZero),
				pData(nullptr)
	{
		memset(arrValue, 0, sizeof(arrValue));
	}

	MessageData(MessageTarget _sender,  MessageTarget _receiver, MessageFlag k, const string& s):
				sender(_sender), receiver(_receiver), key(k), strValue(s), intValue(0), ptValue(cocos2d::CCPointZero) {
		memset(arrValue, 0, sizeof(arrValue));
		pData = nullptr;
	}

	MessageData(MessageTarget _sender,  MessageTarget _receiver, MessageFlag k, int i):
				sender(_sender), receiver(_receiver), key(k), intValue(i), ptValue(cocos2d::CCPointZero) {
		memset(arrValue, 0, sizeof(arrValue));
		pData = nullptr;
	}

	MessageData(MessageTarget _sender,  MessageTarget _receiver, MessageFlag k, void* p):
	sender(_sender), receiver(_receiver), key(k), intValue(0), ptValue(cocos2d::CCPointZero) {
		memset(arrValue, 0, sizeof(arrValue));
		pData = p;
	}
};
